package com.dc.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author feishaobin
 * @email
 * @date 2021-12-30 13:54:26
 */
@Data
@ApiModel
@TableName("dc_region")
public class Region implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @TableId
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "")
    private Long id;
    /**
     * 父级id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "父级id")
    private Long parentId;
    /**
     * 区域名称
     */
    @ApiModelProperty(value = "区域名称")
    private String regionName;

    @TableField(exist = false)
    @ApiModelProperty(value = "子集合")
    private List<Region> children = new ArrayList<>();

}
